//
//  ViewController.m
//  ScrollviewCircle
//
//  Created by liangcheng on 16/1/11.
//  Copyright © 2016年 liangcheng. All rights reserved.
//

#import "ViewController.h"
#import "DetailViewController.h"
#import "CircleScrollView.h"

@interface ViewController ()<CircleScrollViewDelegate>
@property (nonatomic, strong) NSArray *images;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor orangeColor];
    _images = @[@"1.png",@"2.png",@"3.png",@"4.png",@"5.png"];
    NSLog(@"%ld",_images.count);
    
    self.automaticallyAdjustsScrollViewInsets = NO;
    CircleScrollView *circle = [[CircleScrollView alloc] initWithFrame:CGRectMake(0, 64, self.view.frame.size.width, 300)];
    circle.delegate = self;
    [circle setImageDataSource:_images];
    [self.view addSubview:circle];

}

- (void)didClickPage:(CircleScrollView *)view atIndex:(NSInteger)index {
    
    NSLog(@"点击第%ld页", index);
    DetailViewController *detailViewController = [[DetailViewController alloc] init];
    detailViewController.page = index;
    [self.navigationController pushViewController:detailViewController animated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



@end
